require 'date';
class Session < ActiveRecord::Base
  set_table_name 'session'
  set_primary_key 'session_id'

  belongs_to :task,
             :class_name  => 'Task',
 	     :foreign_key => 'task_fk'
 
  
  validates_presence_of :task_fk, :start;


  # end
  # end this session; add end time

  def end
      update_attributes(:end => DateTime.now);    
  end

end
